import React, { SVGProps } from "react";

type FolderIconProps = SVGProps<SVGSVGElement> & {
  open?: boolean;
};

export const FolderIcon: React.FC<FolderIconProps> = ({
  open = false,
  ...props
}) => {
  if (open)
    return (
      <svg
        xmlns="http://www.w3.org/2000/svg"
        height="16"
        width="16"
        viewBox="0 4.999993801116943 48.00153350830078 38.00000762939453"
        {...props}
      >
        <g>
          <path
            d="M47.398 18.2a2.975 2.975 0 0 0-2.4-1.2H42v-3a4.005 4.005 0 0 0-4-4H22.748a1.992 1.992 0 0 1-1.552-.74l-1.96-2.412A4.979 4.979 0 0 0 15.357 5H4a4.005 4.005 0 0 0-4 4v29.571A4.434 4.434 0 0 0 4.429 43h33.663a4.453 4.453 0 0 0 4.254-3.19l5.533-18.97a2.975 2.975 0 0 0-.48-2.64ZM4.428 41A2.431 2.431 0 0 1 2 38.571V9a2.002 2.002 0 0 1 2-2h11.355a2.986 2.986 0 0 1 2.33 1.109l1.958 2.413A3.985 3.985 0 0 0 22.748 12H38a2.002 2.002 0 0 1 2 2v3H16.572a4.453 4.453 0 0 0-4.252 3.19L6.76 39.251A2.442 2.442 0 0 1 4.429 41Zm41.53-20.72-5.532 18.97A2.443 2.443 0 0 1 38.091 41H8.13a4.368 4.368 0 0 0 .551-1.189l5.56-19.061A2.443 2.443 0 0 1 16.572 19H45a1 1 0 0 1 .96 1.28Z"
            fill="currentColor"
            opacity="1"
          ></path>
        </g>
      </svg>
    );

  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      version="1.1"
      width="16"
      height="16"
      x="0"
      y="0"
      viewBox="0 0 32 32"
      xmlSpace="preserve"
      {...props}
    >
      <g>
        <path
          d="M27 9H16a1.004 1.004 0 0 1-.8-.4l-1.8-2.4A3.016 3.016 0 0 0 11 5H5a3.003 3.003 0 0 0-3 3v16a3.003 3.003 0 0 0 3 3h22a3.003 3.003 0 0 0 3-3V12a3.003 3.003 0 0 0-3-3zm1 15a1.001 1.001 0 0 1-1 1H5a1.001 1.001 0 0 1-1-1V8a1.001 1.001 0 0 1 1-1h6a1.004 1.004 0 0 1 .8.4l1.8 2.4A3.016 3.016 0 0 0 16 11h11a1.001 1.001 0 0 1 1 1z"
          opacity="1"
          fill="currentColor"
        />
      </g>
    </svg>
  );
};
